/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.factory.abstractFactory;

import com.aeky.factory.abstractFactory.data.product.Pizza;

/**
 * 所有加盟店PizzaStore的公共父类
 * 
 * @author aeky
 */
public abstract class BasePizzaStore {

    /**
     * 订购Pizza
     * 
     * @param type
     * @return
     */
    public Pizza OrderPizza(String type) {
        Pizza pizza = createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }

    /**
     * 生产Pizza，具体方式由子类决定
     * 
     * @param type
     * @return
     */
    protected abstract Pizza createPizza(String type);
}
